{#**
 * 2007-2020 PrestaShop SA and Contributors
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2020 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}
{% set isModuleActive = module.database.active|default('0') %}

<div
  class="module-item module-item-list col-md-12 {% if origin == 'manage' and isModuleActive == '0' %}module-item-list-isNotActive{% endif %}"
  data-id="{{ module.attributes.id }}"
  data-name="{{ module.attributes.displayName }}"
  data-scoring="{{ module.attributes.avgRate }}"
  data-logo="{{ module.attributes.img }}"
  data-author="{{ module.attributes.author }}"
  data-version="{{ module.attributes.version }}"
  data-description="{{ module.attributes.description }}"
  data-tech-name="{{ module.attributes.name }}"
  data-child-categories="{{ module.attributes.categoryName }}"
  data-categories="{{ category }}"
  data-type="{{ module.attributes.productType }}"
  data-price="{{ module.attributes.price.raw }}"
  data-active="{{ isModuleActive }}"
  data-last-access="{{ module.database.last_access_date }}"
>
  <div class="container-fluid">
    <div class="module-item-wrapper-list row">
      <div class="col-sm-12 col-md-12 col-lg-1 text-sm-center">
        <div class="module-logo-thumb-list">
          <img src="{{ module.attributes.img }}" class="text-md-center" alt="{{ module.attributes.displayName }}"/>
        </div>
      </div>
      <div class="col-md-12 col-lg-11 row">
        <div class="col-sm-12 col-md-10 col-lg-11">
          <h3
            class="text-ellipsis module-name-list"
            data-toggle="pstooltip"
            data-placement="top"
            title="{{ module.attributes.displayName|raw }}"
          >
            {% if module.attributes.displayName %}
              {{ module.attributes.displayName|raw }}

            {% else %}
              {{ module.attributes.name }}
            {% endif %}
            <span class="h5">
                {% for pico in module.attributes.picos %}
                    <span class="{{pico.class|default('')}}"><img src="{{pico.img}}" alt="{{pico.label}}" /> {{ pico.text}}</span>
                {% endfor %}
            </span>
          </h3>
        </div>
        <div class="col-sm-12 col-md-2">
          <span class="text-ellipsis small-text">
            {% block addon_version %}
              {% if module.attributes.productType == "service" %}
                {{ 'Service by %author%'|trans({'%author%' : '<b>' ~ module.attributes.author ~ '</b>'}, 'Admin.Modules.Feature')|raw }}
              {% else %}
                {{ 'v%version% - by %author%'|trans({ '%version%' : module.attributes.version, '%author%' : '<b>' ~ module.attributes.author ~ '</b>' }, 'Admin.Modules.Feature')|raw }}
              {% endif %}
            {% endblock %}
          </span>
        </div>
        <div class="col-sm-12 col-md-8 col-lg-7">
          {% block addon_description %}
            {{ module.attributes.description|raw }}
            {% if module.attributes.description|length > 0 and module.attributes.description|length < module.attributes.fullDescription|length %}
              ...
            {% endif %}
            <span>
              {% if module.attributes.id != "0" %}
                <a class="module-read-more-list-btn url" href="{{ path('admin_module_cart', {"moduleId": module.attributes.id }) }}" data-target="#module-modal-read-more-{{module.attributes.name }}{{ additionalModalSuffix|default('') }}">{{ 'Read More'|trans({}, 'Admin.Modules.Feature') }}</a>
              {% endif %}
            </span>
          {% endblock %}
        </div>
        <div class="col-sm-12 col-md-12 col-lg-3 text-md-right">
          {% if requireBulkActions is defined and requireBulkActions == true %}
            <div class="module-checkbox-bulk-list md-checkbox">
              <label>
                <input type="checkbox" data-name="{{ module.attributes.displayName }}" data-tech-name="{{module.attributes.name}}" />
                <i class="md-checkbox-control"></i>
              </label>
            </div>
          {% endif %}
          {% include '@PrestaShop/Admin/Module/Includes/action_menu.html.twig' with { 'module': module } %}
        </div>
        {% include '@PrestaShop/Admin/Module/Includes/modal_read_more.html.twig' with { 'module': module, 'additionalModalSuffix': additionalModalSuffix|default('') } %}
        {% include '@PrestaShop/Admin/Module/Includes/modal_confirm.html.twig' with { 'module': module } %}
      </div>
    </div>
  </div>
</div>
